//VERSION 2.0

package com.deltachi.lateplates;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Color;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TextView;

public class LatePlate extends TabActivity {
	
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    setContentView(R.layout.main);

	    //Resource object to get Drawables
	    Resources res = getResources(); 
	    
	    //The activity TabHost
	    TabHost tabHost = getTabHost();  
	    
	    //Resusable TabSpec for each tab
	    TabHost.TabSpec spec;  
	    
	    //Reusable Intent for each tab
	    Intent intent;  

	    // Create an Intent to launch an Activity for the tab (to be reused)
	    intent = new Intent().setClass(this, SubmitActivity.class);
	    
	    // Initialize a TabSpec for each tab and add it to the TabHost
	    spec = tabHost.newTabSpec("submit").setIndicator("Submit",
	                      res.getDrawable(R.drawable.submit_tab))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    // Do the same for the other tabs
	    intent = new Intent().setClass(this, MenuActivity.class);
	    spec = tabHost.newTabSpec("menu").setIndicator("Menu",
	                      res.getDrawable(R.drawable.menu_tab))
	                  .setContent(intent);
	    tabHost.addTab(spec);

	    intent = new Intent().setClass(this, MyPlatesActivity.class).addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
	    spec = tabHost.newTabSpec("my_plates").setIndicator("My Plates",
	                      res.getDrawable(R.drawable.my_plates_tab))
	                  .setContent(intent);
	    tabHost.addTab(spec);
	    
	    tabHost.setCurrentTab(0);
	}

}
